<!--
  Generated template for the CookBookPage page.

  See http://ionicframework.com/docs/components/#navigation for more info on
  Ionic pages and navigation.
-->
<ion-header>

  <ion-navbar>
    <ion-title>菜单</ion-title>
  </ion-navbar>
  <div class="duty">
    <div class="dutyItem" tappable (click)="change(1)">
        <span class="{{changeType == 1?'duty-title':''}}">本周菜单</span>
    </div>
    <div class="dutyItem" tappable (click)="change(2)">
        <span class="{{changeType == 2?'duty-title':''}}">上周菜单</span>
    </div>
</div>
</ion-header>

<ion-content padding>
  <ng-container *ngIf="changeType == 1">
    <div class="cookbook">
      <div class="container" *ngFor="let items of dataList">
        <table border="1">
         <thead> 
            <tr>
              <th class="cook_rq" style="width:12rem"><span>菜类</span></th>
              <th class="cook_rq"><span>{{items[0].disDate.slice(6,12)}}{{items[0].disMon}}</span></th>
              <th class="cook_rq"><span>点赞</span></th>
            </tr>
          </thead>
          <tbody *ngFor="let data of items;let j = index">
            <tr *ngFor="let item of data.fileList;let k = index">
                <td *ngIf="k == 0" [attr.rowspan]="data.fileList.length">{{data.disType}}</td>
                <td>{{item.disName}}</td>
                <td>
                  <span>
                    <img [ngClass]="item.pj == '1' ? 'icon-red':'icon-ash'" src="./assets/imgs/home/icon_zmh.png" tappable (click)="changeIcon(item,'1')">
                  </span>
                  <span>
                    <img [ngClass]="item.pj == '0' ? 'icon-red':'icon-ash'" src="./assets/imgs/home/icon_fmh.png" tappable (click)="changeIcon(item,'0')">
                  </span>
                </td>
            </tr>
        </tbody>
        </table>
      </div>  
    </div>
  </ng-container>
  <ng-container *ngIf="changeType == 2">
    <div class="cookbook">
      <div class="container" *ngFor="let items of dataList">
        <table border="1">
         <thead> 
            <tr>
              <th class="cook_rq" style="width:12rem"><span>菜类</span></th>
              <th class="cook_rq"><span>{{items[0].disDate.slice(6,12)}}{{items[0].disMon}}</span></th>
              <th class="cook_rq"><span>点赞</span></th>
            </tr>
          </thead>
          <tbody *ngFor="let data of items;let j = index">
            <tr *ngFor="let item of data.fileList;let k = index">
                <td *ngIf="k == 0" [attr.rowspan]="data.fileList.length">{{data.disType}}</td>
                <td>{{item.disName}}</td>
                <td>
                  <span>
                    <img [ngClass]="item.pj == '1' ? 'icon-red':'icon-ash'" src="./assets/imgs/home/icon_zmh.png" tappable (click)="changeIcon(item,'1')">
                  </span>
                  <span>
                    <img [ngClass]="item.pj == '0' ? 'icon-red':'icon-ash'" src="./assets/imgs/home/icon_fmh.png" tappable (click)="changeIcon(item,'0')">
                  </span>
                </td>
            </tr>
        </tbody>
        </table>
      </div>   
    </div>
  </ng-container>
</ion-content>